package com.spsoft.vatoutinv.enums;

import lombok.Getter;

/**
 * 生成发票类型枚举
 *
 * @author wangy
 */
@Getter
public enum GenerateInvoiceEnum {
    BASE_INVOICE("00", "基础发票"),
    REAL_ESTATE_SALES_INVOICE("05", "不动产销售"),
    REAL_ESTATE_LEAS_INVOICE("06", "不动产经营租赁服务"),
    PASSENGER_TRANSPORTATION_INVOICE("09", "旅客运输服务");


    private final String code;
    private final String name;

    GenerateInvoiceEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static GenerateInvoiceEnum getByCode(String code) {
        for (GenerateInvoiceEnum value : GenerateInvoiceEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

}
